// import Mock from 'mockjs'
import type { MockMethod } from 'vite-plugin-mock'

export default [
  // 获取顶层节点元素
  {
    url: '/api/auth/topnode',
    method: 'get',
    response: () => {
      return {
        code: 0,
        msg: 'ok',
        data: [
          {
            id: 1,
            name: '信息汇总',
          },
          {
            id: 2,
            name: '后台设置',
          },
          {
            id: 3,
            name: '电影管理',
          },
        ],
      }
    },
  },
  // 权限节点列表 -- 不分页
  {
    url: '/api/auth/list',
    method: 'get',
    response: () => {
      return {
        code: 0,
        msg: 'ok',
        data: [
          {
            id: 1,
            name: '天气预报',
            ename: 'weather',
            pid: 1,
            menu: 0,
            route: '/weathers',
            icon: 'Sunrise',
            children: [],
          },
          {
            id: 2,
            name: '人员管理',
            ename: 'people',
            pid: 2,
            menu: 0,
            route: '/user/list',
            icon: 'UserFilled',
            children: [],
          },
          {
            id: 3,
            name: '采收订单',
            ename: 'harvestOrders',
            pid: 3,
            menu: 0,
            route: '/orders',
            icon: 'Platform',
          },
          {
            id: 4,
            name: '产品溯源',
            ename: 'productTraceability',
            pid: 4,
            menu: 0,
            route: '/product',
            icon: 'Place',
          },
        ],
      }
    },
  },
] as MockMethod[]
